wifi-scripts: add support for using list for iface in wifi-station/vlan
authorRany Hany <[email protected]>
Sat, 29 Nov 2025 00:04:09 +0000 (00:04 +0000)
committerRobert Marko <[email protected]>
Mon, 15 Dec 2025 11:30:15 +0000 (12:30 +0100)
This is a trivial change to allow users to use 'list' on iface.
Old wifi-scripts already implements this, so this just ensures
that shell-based and ucode wifi-scripts are on-par with each other.

Signed-off-by: Rany Hany <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/20977
Signed-off-by: Robert Marko <[email protected]>
package/network/config/wifi-scripts/files/lib/netifd/wireless.uc

index ad935ce41479bc44c1a798ed2821eefedf08e93b..cb505a9eb8b9611e26fca9797e824e8501b3d28b 100644 (file)
@@ -192,8 +192,9 @@ function config_init(uci)
        }
 
        for (let name, data in sections.vlan) {
+               let ifaces = parse_array(data.iface);
                for (let iface, iface_vifs in vifs) {
-                       if (data.iface && data.iface != iface)
+                       if (length(ifaces) && index(ifaces, iface) < 0)
                                continue;
 
                        for (let vif in iface_vifs) {
@@ -214,8 +215,9 @@ function config_init(uci)
        }
 
        for (let name, data in sections.station) {
+               let ifaces = parse_array(data.iface);
                for (let iface, iface_vifs in vifs) {
-                       if (data.iface && data.iface != iface)
+                       if (length(ifaces) && index(ifaces, iface) < 0)
                                continue;
 
                        for (let vif in iface_vifs) {